2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-9 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_FILTERGRAPHEDITOR_JUCEHEADER__
27 #define __JUCE_FILTERGRAPHEDITOR_JUCEHEADER__
29 #include "FilterGraph.h"
31 class FilterComponent
;
32 class ConnectorComponent
;
36 //==============================================================================
38 A panel that displays and edits a FilterGraph.
40 class GraphEditorPanel
: public Component
,
44 GraphEditorPanel (FilterGraph
& graph
);
47 void paint (Graphics
& g
);
48 void mouseDown (const MouseEvent
& e
);
50 void createNewPlugin (const PluginDescription
* desc
, int x
, int y
);
52 FilterComponent
* getComponentForFilter (const uint32 filterID
) const;
53 ConnectorComponent
* getComponentForConnection (const AudioProcessorGraph::Connection
& conn
) const;
54 PinComponent
* findPinAt (const int x
, const int y
) const;
57 void changeListenerCallback (ChangeBroadcaster
*);
58 void updateComponents();
60 //==============================================================================
61 void beginConnectorDrag (const uint32 sourceFilterID
, const int sourceFilterChannel
,
62 const uint32 destFilterID
, const int destFilterChannel
,
64 void dragConnector (const MouseEvent
& e
);
65 void endDraggingConnector (const MouseEvent
& e
);
67 //==============================================================================
70 ConnectorComponent
* draggingConnector
;
72 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GraphEditorPanel
);
76 //==============================================================================
78 A panel that embeds a GraphEditorPanel with a midi keyboard at the bottom.
80 It also manages the graph itself, and plays it.
82 class GraphDocumentComponent
: public Component
85 //==============================================================================
86 GraphDocumentComponent (AudioDeviceManager
* deviceManager
);
87 ~GraphDocumentComponent();
89 //==============================================================================
90 void createNewPlugin (const PluginDescription
* desc
, int x
, int y
);
92 //==============================================================================
95 //==============================================================================
99 //==============================================================================
100 AudioDeviceManager
* deviceManager
;
101 AudioProcessorPlayer graphPlayer
;
102 MidiKeyboardState keyState
;
104 GraphEditorPanel
* graphPanel
;
105 Component
* keyboardComp
;
106 Component
* statusBar
;
108 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GraphDocumentComponent
);
111 //==============================================================================
112 /** A desktop window containing a plugin's UI.
114 class PluginWindow
: public DocumentWindow
116 PluginWindow (Component
* const uiComp
,
117 AudioProcessorGraph::Node
* owner_
,
118 const bool isGeneric_
);
121 static PluginWindow
* getWindowFor (AudioProcessorGraph::Node
* node
,
122 bool useGenericView
);
124 static void closeCurrentlyOpenWindowsFor (const uint32 nodeId
);
126 static void closeAllCurrentlyOpenWindows();
131 void closeButtonPressed();
134 AudioProcessorGraph::Node
* owner
;